package com.example.demo.pattern.commandpattern.command;

public class LightOnCommand implements Command {
    private final Light light;

    public LightOnCommand(Light light) {
        this.light = light;
    }

    @Override
    public void execute() {
        //主要在于此，外部并不知道在这里具体做了什么，外面只知道lightOnCommand.execute();
        light.on();
    }
}
